<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let arrAll = [4, 0, 9, 5, 0, 20, 3, 0, 11, 0 , 0, 10]
    let newArr = []
    for (let i = 0; i < arrAll.length; i++) {
      if (arrAll[i] !== 0) {
        newArr.push(arrAll[i])
      }
    }
    console.log(newArr)
  </script>
</body>
</html>